package kr.kimkisik.middle1math.danwon07;

import com.nbpcorp.mobilead.sdk.MobileAdListener;
import com.nbpcorp.mobilead.sdk.MobileAdView;

import kr.kimkisik.middle1math.R;
import kr.kimkisik.middle1math.danwon.DanwonMain;
import kr.kimkisik.middle1math.gyesan.GyesanMain;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class Danwon7_6 extends Activity implements MobileAdListener {
	private MobileAdView adView = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.danwon_danwon07_6);
		adView = (MobileAdView) findViewById(R.id.adview1);
		adView.setListener(this);
		adView.start();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		if (adView != null) {
			adView.destroy(); // 10
			adView = null;
		}
	}

	@Override
	public void onReceive(int err) {
		// event for receive ad
	}

	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	public boolean onOptionsItemSelected(MenuItem item) {
		Intent intent = new Intent();
		switch (item.getItemId()) {

		case R.id.danwonmenu:
			intent.setClass(this, DanwonMain.class);
			startActivity(intent);
			return true;

		case R.id.gyesan:
			intent.setClass(this, GyesanMain.class);
			startActivity(intent);
			return true;

		}
		return false;
	}
}
